<?php

declare(strict_types=1);

namespace App\Request\Client\Certification;


use App\Constants\Regex;
use Hyperf\Validation\Request\FormRequest;

class CompanyRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'name' => [
                'required',
                'regex:' . Regex::CHS,
                'min:6',
                'max:30'
            ],
            'credit_code' => 'required',
            'license_img_id' => 'required'
        ];
    }

    public function messages(): array
    {
        return [
            'name.regex' => 'name ' . Regex::CHS_MESSAGE
        ];
    }

}